# -*- coding: cp932 -*-
'''
Created on 2012/04/21

@author: rusyou
'''
from AbstractDisplay import AbstractDisplay

class StringDisplay(AbstractDisplay):
    '''
    classdocs
    '''

    def __init__(self, msg):
        '''
        Constructor
        '''
        self.msg = msg
        self.width = len(msg)

    def predisp(self):
        self.dispLine()

    def maindisp(self):
        print "|" + self.msg + "|"

    def postdisp(self):
        self.dispLine()

    def dispLine(self):
        print "+",
        i = 0
        while(i < self.width):
            print "-",
            i += 1
        print "+"
